﻿using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;

namespace Sharp.Infrastructure.WebApiClient
{
    internal class HttpClientAdapter : IHttpClient
    {
        private HttpClient _httpClient;

        internal HttpClientAdapter(HttpClient httpClient)
        {
            _httpClient = httpClient;
        }

        public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
        {
            return _httpClient.SendAsync(request);
        }


        public HttpResponseMessage Send(HttpRequestMessage request)
        {
            return _httpClient.SendAsync(request).Result;
        }
    }
}